#ifndef OPASSIGN
#define OPASSIGN

#include "VMPFocus.hpp"
#include "operations.hpp"
//Operation =
//formula:
//(:higher:|:same:):blank:?=:blank:?:name:

//PreLining:
cText TEXT_ASSIGN="=";

void funOpAssignPreL(ListIdentity* what){
	fPreL_priority(&TEXT_ASSIGN, what);
};
//PostLining:

//MkTree:

//Evaluate:
//important: ptrDough -> evaResult{ptrDough, ptrDough*}
struct evaResult{
	ptrDough dough;
	ptrDough* var;
};

sRecord funOpAssignEva(ptrRETNode retnode, ptrParsedElement pe, void* ext){
	sRecord* Elvalue=eval(retnode,pe->SubElements[0],ext).var; //Lvalue -> specific sRecord on VarList.
	ptrDough Ervalue=eval(retnode,pe->SubElements[0],ext).dough;

	Elvalue->dough=Ervalue;
	return sRecord(Ervalue, Elvalue);
}

ptrOperation loadOpAssign(){
	return new cOperation(
		"=",
		"(:higher:|:same:):blank:?=:blank:?(:higher:|:same:)", //Needs to be finished.
		funOpAssignEva
	);
}
#endif